package com.zq.server.api.dao;


import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.zq.server.api.domain.entity.ApiTag;

/**
 * @author Super
 * @description 针对表【tag】的数据库操作Mapper
 * @createDate 2024-03-04 00:39:16
 * @Entity com.zq.daomain.entity.Tag
 */

@Mapper
public interface TagMapper {

    /**
     * 获取集合
     *
     * @return
     */
    @Select("select  tag_name,`describe`,id from api_tag")
    List<ApiTag> list();

    /**
     * 添加标签
     *
     * @param tag
     */
    void save(ApiTag tag);

    /**
     * 批量修改标签使用次数
     */
    void updateTagUsageCount(@Param("tagIdList") List tagIdList);


    /**
     * 获取所有tagList
     */
    @Select("select id from api_tag")
    int[] getTagIdList();


    /**
     * 获取用户所需的
     *
     * @param cancelTagIds
     * @return
     */
    List<ApiTag> getUserNeedTagList(@Param("cancelTagIds") List<Integer> cancelTagIds);
}
